extends "../i_horse/i_horse.gd"
var flag
func init():
    .init()
    name = "赤龙驹"
    resetdata()
    info = "警戒.火：高度警惕，每秒对周围一格敌人添加一层<烧灼>；若被攻击，则10%为敌人附加5层<烧灼>[cd:3 秒]\n" + info

func _connect():
    ._connect()
    masCha.connect("onHurt",self,"jjb")
    masCha.connect("onBattleStart",self,"resetflag")

func resetflag():
    flag = 1

func jjb(atkinfo):
    if atkinfo.isMiss || atkinfo.atkCha == null || !flag:return
    if sys.rndPer(10):
        flag = 0
        atkinfo.atkCha.addBuff(b_shaoZhuo.new(5))

func _upS():
    ._upS()
    if !flag:
        cnt2 += 1
        if cnt2 == 3:
            cnt2 = 0
            flag = 1
    var v = [Vector2(-1,1),Vector2(0,1),Vector2(1,1),Vector2(-1,0),Vector2(1,0),Vector2(-1,-1),Vector2(0,-1),Vector2(1,-1)]
    for i in v:
        var tmp = sys.main.matCha(masCha.cell + i)
        if tmp && tmp.get("team") != masCha.team:
            tmp.addBuff(b_shaoZhuo.new(1))
